#pragma once

#include <iostream>
#include <cstdio>
#include <cstring>
#include <cerrno>
#include <unistd.h>
#include <fcntl.h>

using namespace std;

void setNonBlock(int fd)
{
    int fl = fcntl(fd, F_GETFL);
    if (fl == -1)
    {
        cout << "fcntl: " << strerror(errno) << endl;
        return;
    }
    fcntl(fd, F_SETFL, fl | O_NONBLOCK);//将对应的文件描述符设置为非阻塞状态
}

void printlog()
{
    cout << "this is a log" << endl;
}

void download()
{
    cout << "download something.." << endl;
}

void execsql()
{
    cout << "execute sql now" << endl;
}